import { request } from "@/utils/request.js"
import infrastructureViewMockData from "@/mock/data/infrastructure/index.js"


function query(mockDataName) {
    const { integrationData, catalog } = infrastructureViewMockData;
    const { data: result } = integrationData[catalog.indexOf(mockDataName)];
    return { data: result }
}

/**
 * 基础设施监控下拉框IP
 * @param {*} options 
 * @returns 
 */
export function getIPSelectData(options = {}) {
    return request({
        url: `sjzt/jcssmx/ipxlk`,
        method: 'get',
        mockFilter: (req, mockDataName = "ipxlk") => {
            return query(mockDataName)
        },
        params: options
    })

}


/**
 * 基础设施监控折线图汇总新
 * @param {} options 
 * @returns 
 */
export function getLineChartData(options = {}) {
    return request({
        url: `sjzt/jcssjk/zxthznew`,
        method: 'get',
        mockFilter: (req, mockDataName = "zxthznew") => {
            return query(mockDataName)
        },
        params: options
    })

}

/**
 * 基础设施监控弹窗查询echat图数据
 * @param {} options 
 * @returns 
 */
export function getCharData(options = {params}) {
    return request({
        url: `sjzt/jcssjk/zxthznew`,
        method: 'get',
        mockFilter: (req, mockDataName = "newCharData") => {

            return query(mockDataName)
        },
        params: options
    })

}

/**
 * 基础设施监控总览新
 * @param {} options 
 * @returns 
 */
export function getOverviewData(options = {}) {
    return request({
        url: `sjzt/jcssjk/zlxx`,
        method: 'get',
        mockFilter: (req, mockDataName = "zlxx") => {
            return query(mockDataName)
        },
        params: options
    })

}

/**
 * 基础设施监控新
 * @param {} options 
 * @returns 
 */
export function getOverviewDatanew(options = {}) {
    return request({
        url: `sjzt/jcssjk/zlxx`,
        method: 'get',
        mockFilter: (req, mockDataName = "zlxxnew") => {
            return query(mockDataName)
        },
        params: options
    })

}







